package hos.http;

import java.io.Closeable;
import java.io.IOException;

/**
 * <p>Title: CloseableUtils </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2023/4/3 8:50
 */
public class CloseableUtils {


    public static IOException closeFinally(Closeable... closeable) {
        if (closeable == null) {
            return null;
        }
        try {
            for (Closeable close : closeable) {
                close.close();
            }
        } catch (IOException e) {
            return e;
        }
        return null;
    }

}
